package com.tensquare.search.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;

@Document(indexName="tensquare_article",type="article")
public class Article implements Serializable {
    @Id
    private String id;//ID
    //是否索引，就看该域是否能被搜索?
    //是否分词，就表示搜索的时候是整体匹配还是单词匹配?
    //是否存储，就是是否在页面上显示。这里的显示是指显示到摘要上
    @Field(index= true,analyzer="ik_max_word",searchAnalyzer="ik_max_word")//对应数据库的域
    private String title;//标题
    @Field(index= true,analyzer="ik_max_word",searchAnalyzer="ik_max_word")
    private String content;//文章正文

    private String state;//审核状态

    public String getId() {
        return id;
    }

    public String getContent() {
        return content;
    }

    public String getState() {
        return state;
    }

    public String getTitle() {
        return title;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setState(String state) {
        this.state = state;
    }
}
